<template>
  <div class="todo-header">
    <div class="banxin flex">
      <h2 class="title">TodoList</h2>
      <div class="input">
        <input v-model="val" @keyup.enter="addlist(val)" type="text" placeholder="添加ToDO" />
      </div>
    </div>
  </div>
</template>

<script>
import {mapMutations} from "vuex"
export default {
  data() {
    return {
        val:''
    };
  },
  methods:{
      ...mapMutations(['addlist'])

  },
 

};
</script>
 
<style lang = "less" scoped>
.todo-header {
  background-color: #333;
  height: 100px;
}

.title {
  color: #fff;
}

.input input {
  width: 300px;
  padding-left: 50px;
  height: 45px;
  outline: none;
}

.todo-header .flex {
  justify-content: space-between;
  align-items: center;
  height: 100px;
}
</style>